//
// Created by Castle-Moriarty on 2025/11/4.
//

#include <iostream>
using namespace std;

class A {
public:
    A() {
        name = "jack";
        age = 9;
    }

    string name;
    int age;
};

// 定义类B，继承了类A
class B : public A {
public:
    string aihao;

    B() {
        aihao = "bike";
    }
};


int main() {
    // 继承
    B b1;
    cout << b1.name << endl;
    cout << b1.age << endl;
    cout << b1.aihao << endl;

    return 0;
}
